function testReducer(state = {
  obj: {
    num: 1
  },
  list: [{num: 1}, {num: 2}]
}, action) {

  let preState = { ...state }
  switch (action.type) {
    case 'test':
      const { obj } = preState
      let a = { ...obj }
      a.num = a.num + 1
      preState.obj = a
      return preState;
    case 'testList':
      const { list } = preState
      preState.list = [...list, {num: list[list.length - 1].num + 1}]
      return preState;
    default:
      return state;
  }
}

export default testReducer